package com.wq.util;

import java.io.IOException;
import java.util.Map;

import com.wq.request.RequestAccoutInfo;
import com.wq.request.RequestRealFee;


public class HanderEventMessge {
	
public static String handleEventMessage(Map<String, String> map) throws IOException{
    	
    	String eventType = map.get("Event");
    	String responseMessage="";
System.out.println(eventType);    	
		// 
		if (eventType.equals("CLICK")){
			String eventKey = map.get("EventKey");
System.out.println(eventKey);    
			if (map.get("EventKey").equals("1")) {
				 String msgText  = new RequestRealFee().getFee("13919365568");
				 responseMessage = new MessageBuliderUtil().buildTextMessage(map, msgText);
			} 
			if (map.get("EventKey").equals("2")) {
				 String msgText  = new RequestAccoutInfo().getAcctInfo("13919365568");
				 responseMessage = new MessageBuliderUtil().buildTextMessage(map, msgText);
			} 
        }
		
		 return responseMessage;
	}

}
